Skip to content

Fix install error handling#1456

Open
maxugly wants to merge 2 commits intosinelaw:masterfrom
maxugly:fix-install-error-handling
Open

Fix install error handling#1456
maxugly wants to merge 2 commits intosinelaw:masterfrom
maxugly:fix-install-error-handling

Conversation

@maxugly
Copy link
Copy Markdown
Contributor

@maxugly maxugly commented Apr 2, 2026

Problem

The AppImage installer currently fails silently if mktemp or curl fails, reporting a "Success" message even if no files were moved. Additionally, it fails on systems with restricted /tmp permissions (such as Void Linux or certain containers).

Solution

This PR introduces several robustness improvements to ensure a clean and honest installation process:

  • Atomic Cleanup: Added a trap to ensure the temporary workspace is deleted on exit or interruption.
  • Environment Fallback: Implemented a fallback to $HOME/.cache if the system /tmp is not writable.
  • Error Checking: Added exit-code verification for curl, mktemp, and mv to prevent "fake success" messages.
  • Validation: The script now verifies the existence of the extracted binary before moving it to the final destination.

Testing

Verified on Void Linux x86_64. The script now correctly falls back to local storage when /tmp is restricted and successfully completes the installation.

@maxugly maxugly force-pushed the fix-install-error-handling branch from 675809d to 428d0c3 Compare April 2, 2026 08:10
@maxugly
Copy link
Copy Markdown
Contributor Author

maxugly commented Apr 3, 2026

Subject: Context for the regex adjustment

Following up on this one: this patch allows for casing variations (e.g., .AppImage vs .appimage) and version-string formatting that were causing an install failure on my Void Linux setup.

This works alongside the fix you just merged in #1455 to get the installer running here. Thanks for merging that one! Happy to refine the pattern if you have a preferred regex style.

Comment thread scripts/install.sh
do_install_appimage() {
log_info "Attempting AppImage install..."
if ! check_cmd curl; then log_error "curl is required."; fi
if ! check_cmd curl; then log_error "curl is required."; return 1; fi
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log_error already exits, no need for return

Comment thread scripts/install.sh
fi

log_info "Finalizing installation..."
mkdir -p "$INSTALL_DIR" "$BIN_DIR"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INSTALL_DIR is immediately removed after being created here, can skip creation

Comment thread scripts/install.sh
rm -rf "$TEMP_EXTRACT"

# Atomic update of the installation directory
rm -rf "$INSTALL_DIR"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potentially destroys user data? can we move to tmp dir instead?

Copy link
Copy Markdown
Owner

@sinelaw sinelaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants